set BuildFolder=build
set CacheFile=CMakeCache.txt

del /f/q/s build

if not exist %BuildFolder% (
    md %BuildFolder%
)

cd build

@REM del /f/q/s CMakeFiles
@REM del /f/q/s cmake_install.cmake
@REM del /f/q/s Makefile

if not exist %CacheFile% (
    cmake -DCMAKE_TOOLCHAIN_FILE="arm-none-eabi-gcc.cmake" -G "Unix Makefiles" -DUSB_TYPE=HID ..
)

cmake --build . -j16